.font-manager {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f0f2f5;
}

.search-header {
  background: #fff;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.search-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.search-input {
  width: 300px;
}

.batch-controls .batch-mode-active {
  background: #1890ff;
  border-color: #1890ff;
  color: #fff;
}

.batch-controls .batch-mode-active:hover {
  background: #40a9ff;
  border-color: #40a9ff;
}

.batch-toolbar {
  background: #f5f5f5;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
}

.batch-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.batch-actions .ant-checkbox-wrapper {
  font-weight: 500;
}

.stats-info {
  font-size: 14px;
}

.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
}

.font-list-panel {
  flex: 1;
  background: #fff;
  overflow-y: auto;
  height: 100%;
  position: relative;
  padding: 20px 60px;
}

.font-list-content {
  width: 100%;
  height: 100%;
}

.loading-state {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.loading-text {
  color: #666;
  font-size: 14px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.fonts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.font-card {
  position: relative;
  background: #fff;
  border-radius: 2px;
  padding: 8px 12px;
  border: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 80px;
  transition: all 0.2s ease;
}

.font-card:hover {
  border-color: #a0a0a0;
}

.font-card.batch-mode {
  cursor: pointer;
  padding-left: 16px;
}

.font-card.batch-mode:hover {
  background: #f5f5f5;
  border-color: #1890ff;
}

.font-card.selected {
  background: #e6f7ff;
  border-color: #1890ff;
  box-shadow: 0 2px 4px rgba(24, 144, 255, 0.1);
}

.batch-checkbox {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.font-card.batch-mode .font-image {
  margin-left: 20px;
}

.font-image {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-image .svg-icon {
  max-width: 100%;
  max-height: 100%;
  transition: filter 0.2s ease;
}

.svg-container {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.svg-container svg {
  max-width: 100%;
  max-height: 100%;
}

.svg-loading,
.svg-error {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #999;
  background: #f5f5f5;
  border-radius: 4px;
}

.font-content {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.font-name {
  font-size: 14px;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.font-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.font-size,
.font-date {
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.3;
}

.font-size {
  font-weight: 500;
  color: #595959;
}

.font-actions {
  position: absolute;
  top: 38px;
  right: 8px;
}

.menu-trigger {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: #8c8c8c;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #666;
}

.loading-spinner.small {
  width: 24px;
  height: 24px;
  border-width: 2px;
  margin-bottom: 12px;
}

.no-more {
  display: flex;
  justify-content: center;
  padding: 40px 20px;
  color: #999;
  border-top: 1px solid #f0f0f0;
  margin-top: 20px;
}

.empty-actions {
  margin-top: 16px;
}

/* 设置面板样式 */
.settings-panel {
  width: 280px;
  background: #fff;
  height: 100%;
  border: 1px solid #f0f0f0;
  border-top: none;
  border-bottom: 0;
  overflow-y: auto;
}

.settings-content {
  padding: 20px;
  border-radius: 0;
}

.setting-group {
  margin-bottom: 24px;
}

.setting-label {
  font-size: 14px;
  font-weight: 500;
  color: #262626;
  margin-bottom: 12px;
}

.setting-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setting-control .ant-slider {
  flex: 1;
}

.setting-control .ant-input-number {
  width: 80px;
}

/* 颜色选择器样式 */
.color-picker-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-picker {
  width: 32px;
  height: 32px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  padding: 0;
}

.color-picker::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 4px;
}

.color-input {
  flex: 1;
  font-family: monospace;
}

.preset-colors {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preset-colors-label {
  font-size: 12px;
  color: #8c8c8c;
}

.preset-colors-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.preset-color-item {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  border-color: #e8e8e8;
}

.preset-color-item.active {
  border-color: #1890ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.preset-color-item[style*='ffffff'] {
  border: 2px solid #e8e8e8;
}

.preset-color-item[style*='ffffff']:hover,
.preset-color-item[style*='ffffff'].active {
  border-color: #1890ff;
}

.setting-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.option-row {
  display: flex;
  gap: 8px;
}

.option-row .ant-btn {
  flex: 1;
}

.color-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.color-item:hover {
  background-color: #f5f5f5;
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid #e8e8e8;
}

.color-code {
  font-size: 12px;
  font-family: monospace;
  color: #595959;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .search-header {
    padding: 12px 16px;
  }

  .search-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .search-input {
    width: 100%;
  }

  .batch-toolbar {
    margin-top: 8px;
  }

  .batch-actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .main-content {
    flex-direction: column;
  }

  .font-list-panel {
    padding: 16px;
  }

  .fonts-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .font-card {
    padding: 16px;
    min-height: 70px;
  }

  .font-card.batch-mode {
    padding-left: 20px;
  }

  .font-card.batch-mode .font-image {
    margin-left: 16px;
  }

  .batch-checkbox {
    top: 16px;
    left: 16px;
  }

  .font-name {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .font-size,
  .font-date {
    font-size: 11px;
  }

  .settings-panel {
    width: 100%;
    max-height: 300px;
  }
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  background: #fff;
}

.empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-text {
  font-size: 16px;
  color: #666;
  margin-bottom: 8px;
}

.empty-suggestion {
  font-size: 14px;
  color: #999;
}
